package com.atguigu.springcloud.alibaba.service;

import com.atguigu.springcloud.alibaba.domain.CommonResult;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestParam;

/**
 * @param
 * @description: 调用库存微服务
 * @return
 */
@FeignClient(value = "seata-storage-service")
public interface StorageService {

    /**
     * @param productId 商品id
     * @param count     商品数量
     * @return
     * @description: 减库存表
     */
    @PostMapping(value = "/storage/decrease")
    CommonResult decrease(@RequestParam("productId") Long productId, @RequestParam("count") Integer count);
}
